<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.7.1.min.js"></script>
</head>
<body>
<h1>用户名密码登录</h1>
<form action="/login" method="post">
    <table>
        <tr>
            <td>用户名：</td>
            <td><input type="text" name="username" value="root"></td>
        </tr>
        <tr>
            <td>密码：</td>
            <td><input type="password" name="password" value="123"></td>
        </tr>
        <tr>
            <td><input type="submit" value="登录"></td>
        </tr>
    </table>
</form>
<h1>手机验证码登录</h1>
<form action="/login" method="post">
    <table>
        <tr>
            <td>手机号码：</td>
            <td><input type="text" name="phone" id="phone" value="13111111111"></td>
        </tr>
        <tr>
            <td>验证码：</td>
            <td><input type="text" name="code" value="123"></td>
            <td><button type="button" onclick="sendSms()">发送验证码</button></td>
        </tr>
        <tr>
            <td><input type="submit" value="登录"></td>
        </tr>
    </table>
</form>
<script>
    function sendSms() {
        let phone = $("#phone").val();
        $.get('/sendSms',{phone: phone});
    }
</script>
</body>
</html>